/**
 * 广寒宫
 * 网址:www.guanghangong.xyz
 */
package com.moon.admin.flowable.entity;

import java.util.Date;

import org.flowable.engine.history.HistoricProcessInstance;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.moon.admin.framework.domain.Query;

import lombok.Getter;
import lombok.Setter;

/**
 * 历史流程信息
 * @author ninglong
 */
@Getter
@Setter
public class ActCnHistoricProcessEntity extends Query{

	private String id;
	/** 任务名称 */
	private String name;

	/** 任务描述 */
	private String description;

	/** 业务ID */
	private String businessKey;

	/** 流程发起人 */
	private String startUserId;

	/** 流程部署ID */
	private String deployId;

	/** 所属租户ID */
	private String tenantId;

	/** 流程定义ID */
	private String processDefinitionId;

	/** 流程定义名称 */
	private String processDefinitionName;

	/** 流程定义标识 */
	private String processDefinitionKey;

	/** 流程实例版本 */
	private Integer processVersion;

	/** 任务开始时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date startTime;

	/** 任务结束时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date endTime;

	/** 任务状态（0在办 1已办结 2已删除） */
	private Integer status;

	/** 删除原因 */
	private String deleteReason;
	
	/** 回调标识，一般即为JQuery函数名称 */
	private String callbackId;
	
	/** 回调类型，默认为JQueryFunction */
	private String callbackType;
	/**任务(节点)id*/
	private String taskId;
	

	public ActCnHistoricProcessEntity() {
		super();
	}

	/**
	 * 打包封装流程任务对象
	 * @return
	 */
	public ActCnHistoricProcessEntity(HistoricProcessInstance hpi){
		this.setId(hpi.getId());
		name = hpi.getName();
		description = hpi.getDescription();
		businessKey = hpi.getBusinessKey();
		startUserId = hpi.getStartUserId();
		deployId = hpi.getDeploymentId();
		tenantId = hpi.getTenantId();
		processDefinitionId = hpi.getProcessDefinitionId();
		processDefinitionKey = hpi.getProcessDefinitionKey();
		processDefinitionName = hpi.getProcessDefinitionName();
		processVersion = hpi.getProcessDefinitionVersion();
		startTime = hpi.getStartTime();
		endTime = hpi.getEndTime();
		deleteReason = hpi.getDeleteReason();
		callbackId = hpi.getCallbackId();
		callbackType = hpi.getCallbackType();
	}
}
